(1) Field of the Invention
The present invention relates to an OTP microcomputer (One-Time Programmable ROM Microcomputer), namely, one chip microcomputer with a PROM incorporated that allows a program to be written in for once only. The present invention is in particular directed to an OTP microcomputer having a terminal that serves both a power terminal for program writing and an input terminal for another purpose.
(2) Description of the Prior Art
A typical OTP microcomputer is adapted to be able to be set up in either of microcomputer and OTP modes. In the microcomputer mode, the OTP microcomputer performs normal operations as a microcomputer whereas the microcomputer in the OTP mode allows its PROM to be programmed. In order for an OTP microcomputer to allow its PROM to be written in with a program, an input terminal for receiving a voltage for program writing is needed. A voltage of about 12 V or 21 V is usually employed for writing a program. Since, in OTP microcomputers, the writing of a program is effected once only, it is very inefficient and useless to provide a terminal dedicated to the once-only writing of a program. Therefore, a terminal is tried to be used both as the terminal for the writing and as a terminal for the purpose of the normal operations. A problem as follows, however, occurs if a terminal with a pull-up resistance incorporated therein is used as the combined or double-purpose terminal.
FIG. 1 is a circuit diagram in the vicinity of a terminal having a PMOS transistor as an incorporated pull-up resistance. As shown in the figure, the PMOS transistor serving as the pull-up resistance is connected at its source with a voltage Vcc (of normally about 5 V) and grounded at its gate. The drain is connected to an external input terminal A. In this arrangement, if a voltage Vpp (of about 12 V or 21 V, higher than Vcc) is supplied to the external input terminal A for the purpose of writing a program into the PROM, a current tends to flow into Vcc terminal from Vpp terminal by way of the resistance, causing a short-circuit between the two terminals. When the pull-up resistance is composed of a MOS transistor, the current likewise flows into the well in which the MOS transistor is formed, making the two terminals short-circuited. It is apparent that this short-circuit between the two terminals causes the device to be latched up and therefore damages the device.
For these reasons, the power terminal for programming in an OTP microcomputer was adapted be combined with a terminal that does not have a pull-up resistance incorporated therein, such as a terminal for setting up the microcomputer into a test mode (this terminal will hereinafter be referred to as a test terminal). When the OTP microcomputer is operated in the microcomputer mode, the potential of the test terminal is fixed at the power supply voltage or at the ground potential, so that the test terminal need not have a pull-up resistance incorporated therein. Therefore, this terminal could be used also as the power supply terminal for writing a program.
Microcomputers with such a terminal described above in which a pull-up resistance need not be incorporated as the test terminal are free from this kind of problem, but this approach can not be applied to all microcomputers, since a microcomputer having less number of terminals often lacks such a terminal that is suitable for the combination use as described above. As a example of terminals incorporating a pull-up resistance therein, there is a reset terminal which is negatively active. The terminals of this kind are required to make use of a pull-up resistance in order to turn the power on and reset the modes. Therefore, the pull-up resistance is a requisite in such configurations.
To deal with this, a configuration of a reset terminal and the like can be considered in which a terminal with an external pull-up resistance is provided in lieu of the incorporated pull-up resistance; and programming is performed with the pull-up resistance removed while the use in the normal mode is executed with the external pull-up resistance provided.
However, in many practical applications, another one-chip microcomputer with a mask ROM incorporated therein which has the same function with that of the OTP microcomputer including a PROM therein may be provided in the pin-compatible manner with the OTP microcomputer. In such a case, the mask ROM microcomputer must also be provided with another external pull-up resistance. Provision of a terminal having an incorporated pull-up resistance only for the mask ROM might be considered enough, but does not allow the configuration to be pin-compatible, giving rise to a problem that functions and electric characteristics differ between the OTP and mask ROM microcomputers.
A disclosure in Japanese Patent Application Laid-Open Hei 3 No.256182 shows a method of disconnecting a pull-up resistance when a potential in excess of Vcc is supplied to a terminal having the pull-up resistance incorporated therein. In this method, at both times the pull-up resistance is connected and disconnected, a reset signal must be processed or manipulated after the power is turned on. Therefore, this configuration is unsuitable for OTP microcomputers in which the state of the power supply must be determined at and from the onset of the activation of the power supply.
Anther disclosure in Japanese Patent Application Laid-Open Hei 2 No.39722 shows a method of switching voltages of a power supply. The circuit in this method is operated by supplying input of constant voltages to terminals thereof from the outside. Therefore, this is not suitable for a configuration including a terminal incorporating a pull-up resistance which is operated by supplying a voltage to a signal line only through the pull-up resistance without inputting any voltage to the terminal from the outside.